package com.xiaoyu.lanling.media.image;

import android.content.Context;

import com.facebook.imagepipeline.core.ImagePipelineConfig;

import okhttp3.OkHttpClient;

public class OkHttpImagePipelineConfigFactory {

    private static OkHttpNetworkFetcher sOkHttpNetworkFetcher;

    public static OkHttpNetworkFetcher getOkHttpNetworkFetcher() {
        return sOkHttpNetworkFetcher;
    }

    public static ImagePipelineConfig.Builder newBuilder(Context context, OkHttpClient okHttpClient) {
        sOkHttpNetworkFetcher = new OkHttpNetworkFetcher(okHttpClient);
        return ImagePipelineConfig.newBuilder(context)
                .setNetworkFetcher(sOkHttpNetworkFetcher);
    }
}
